package ControlLayer;
import java.util.ArrayList;
import ModelLayer.*;


public class EmployeeCtr
{

    private EmployeeList employeeList;
    private Employee employee;


    public EmployeeCtr()
    {
        employeeList = EmployeeList.getInstance();
    }
    
    public void createEmployee(long userId, String name, String surname, String password, String email, String role, String phoneNumber)
    {
       employee = new Employee(userId, name, surname, password, email, role, phoneNumber);
       employeeList.addEmployee(employee);
    }
    
    public void createEmployeeRoot()
    {
    	employee = new Employee(123456, "Root", "none", "password", "none", "ROOT", "none");
    	employeeList.addEmployee(employee);
    }
    
    
    public void deleteEmployee(long userId)
    {
        employeeList.deleteUser(userId);
    }
    
    public void setEmployeeName(String name, long userId)
    {
        employeeList.findEmployee(userId).setName(name);
    }
    
    public void setEmployeeSurname(String surname, long userId)
    {
        employeeList.findEmployee(userId).setSurname(surname);
    }
    
    public void setEmployeePassword(String password, long userId)
    {
        employeeList.findEmployee(userId).setPassword(password);
    }
    
    public void setEmployeeEmail(String email, long userId)
    {
        employeeList.findEmployee(userId).setEmail(email);
    }
    
    public void setEmployeeRole(String role, long userId)
    {
        employeeList.findEmployee(userId).setRole(role);
    }
    
    public void setEmployeePhoneNumber(String phoneNumber, long userId)
    {
        employeeList.findEmployee(userId).setPhoneNumber(phoneNumber);
    }
    
    public long getEmployeeId(long userId)
    {
        return employeeList.findEmployee(userId).getEmployeeId();
    }
    
    public String getEmployeeName(long userId)
    {
        return employeeList.findEmployee(userId).getName();
    }
    
    public String getEmployeeSurname(long userId)
    {
        return employeeList.findEmployee(userId).getSurname();
    }
    
    public String getEmployeePassword(long userId)
    {
        return employeeList.findEmployee(userId).getPassword();
    }
  
    public String getEmployeeEmail(long userId)
    {
        return employeeList.findEmployee(userId).getEmail();
    }
    
    public String getEmployeeRole(long userId)
    {
        return employeeList.findEmployee(userId).getRole();
    }
    
    public String getEmployeePhoneNumber(long userId)
    {
        return employeeList.findEmployee(userId).getPhoneNumber();
    }
         
}
